﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;

using QLTTAN.DTO;
namespace QLTTAN.DAL
{
    public class ThoiGianHocDAL
    {
        ConnectionData conn;

        public int ThoiGianHoc_Insert(ThoiGianHocDTO TGH_DTO)
        {
            conn = new ConnectionData();

            int Nparameter = 3;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];

            name[0] = "MaLop";
            value[0] = TGH_DTO.MaLop;
            name[1] = "MaNgayHoc";
            value[1] = TGH_DTO.MaNgayHoc;
            name[2] = "MaCaHoc";
            value[2] = TGH_DTO.MaCaHoc;

            return conn.UpdateData("THOIGIANHOC_INSERT", name, value, Nparameter);
        }

        public int ThoiGianHoc_Update(ThoiGianHocDTO TGH_DTO)
        {
            conn = new ConnectionData();

            int Nparameter = 3;
            string[] name = new string[Nparameter];
            object[] value = new object[Nparameter];

            name[0] = "MaLop";
            value[0] = TGH_DTO.MaLop;
            name[1] = "MaNgayHoc";
            value[1] = TGH_DTO.MaNgayHoc;
            name[2] = "MaCaHoc";
            value[2] = TGH_DTO.MaCaHoc;

            return conn.UpdateData("THOIGIANHOC_UPDATE", name, value, Nparameter);
        } 
    }
}
